//
//  TestLayerViewController.m
//  HOrangiOS
//
//  Created by YOrange on 2018/5/11.
//  Copyright © 2018年 YOrange. All rights reserved.
//

#import "TestLayerViewController.h"
#import "TestLayerTableViewCell.h"
#import "JPFPSStatus.h"

@interface TestLayerViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation TestLayerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [[JPFPSStatus sharedInstance] open];

    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    [self.tableView registerNib:[UINib nibWithNibName:@"TestLayerTableViewCell" bundle:nil] forCellReuseIdentifier:@"cellname"];
    self.tableView.rowHeight = 120;

    // Do any additional setup after loading the view from its nib.
}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 100;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    TestLayerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellname" forIndexPath:indexPath];
    
    // 设置layer圆角半径
    cell.bgView.layer.cornerRadius=4.0;
    // 即阴影颜色值
    cell.bgView.layer.shadowColor= [[UIColor blackColor] CGColor];//[[UIColor colorWithWhite:0.5 alpha:0.5] CGColor];
    // 即阴影相对于Y轴有1个像素点的向下位移。
    cell.bgView.layer.shadowOffset = CGSizeMake(0, 0);
    
    //设置阴影的不透明度
    cell.bgView.layer.shadowOpacity = 0.6;
    // 阴影的模糊度
    cell.bgView.layer.shadowRadius = 6.0;
    // 阴影的位置
    cell.bgView.layer.shadowPath = [[UIBezierPath bezierPathWithRect:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width - 24, 120 - 24) /*cell.bgView.bounds*/] CGPath];
    //设置缓存 仅复用时设置此选项。
    cell.bgView.layer.shouldRasterize=YES;
    //设置抗锯齿边缘
    cell.bgView.layer.rasterizationScale=[UIScreen mainScreen].scale;
    return cell;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
